<?php if (is_array($models) && count($models) > 0) : ?>
    <div class="news">
    <?php foreach($models as $model) : $detailUrl = $this->controller->createUrl('/Article/default/view',array('cat_id'=>$model->category_id,'locale'=>$model->localeArticle->locale,'id'=>$model->id,'alias'=>$model->localeArticle->alias)); ?>
        <div class="item clearfix">
            <?php if (!empty($model->image) && file_exists(substr($model->image,1))) : ?>
                <a href="<?php echo $detailUrl; ?>"><img class="img" src="<?php echo baseUrl().$model->image; ?>" /></a>
            <?php endif; ?>
            <h3><a href="<?php echo $detailUrl; ?>"><?php echo $model->localeArticle->title; ?></a></h3>
            <div class="date"><?php $ts = strtotime($model->update_time); echo date('h:i A',$ts).' | '.((Yii::app()->language=='vi_vn') ? date('d/m/Y',$ts) : date('m/d/Y',$ts)); ?></div>
            <div class="content"><?php echo getFirstWordsFromString(strip_tags($model->localeArticle->content),$this->content_limit); ?></div>
        </div>
    <?php endforeach; ?>
    </div>
    <div style="clear: both;"></div>
    <div class="pager">
        <?php
        $this->widget('CLinkPager',array(
            'pages' => $paging,
            'cssFile' => false,
            'header' => ''
        )); ?>
    </div>
<?php else : ?>
    <p><?php echo Yii::t('site/article','NO_ARTICLE'); ?></p>
<?php endif; ?>